import request from "@/api/request";
import { apiClusterJava } from "@/api/root";

// 文库首页
export const getLibraryIndexData = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/activityOpen/home",
    data
  );
};

// 文库搜索排行榜
export const getLibrarySearchRankList = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/activityOpen/recommendActivity",
    data
  );
};

// 文库搜索
export const getSearchList = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/activityOpen/search",
    data
  );
};

// 文库搜索关键词列表
export const getKeywordSearchList = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/activityOpen/keywordSearch",
    data
  );
};

// 文库列表-配置数据列表
export const getConfigList = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/activityOpen/career",
    data
  );
};

// 报告/案例详情
export const getDetail = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/activityOpen/detail",
    data
  );
};

// 报告-首页/搜索
export const reportSearch = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/activityOpen/reportSearch",
    data
  );
};

// 报告/案例权益消耗
export const rightsConsume = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/activityOpen/rightsConsume",
    data
  );
};

// 获取career的tagId配置
export const libraryPage = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/activityOpen/libraryPage",
    data
  );
};
// 通过字典Type获取字典数据
export const getRandomDictData = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/activityOpen/getRandomDictData",
    data
  );
};
